#include <bits/stdc++.h>
#define CI const int&
using namespace std;
int n,k;
int main()
{
	register int i;
	for (scanf("%d%d",&n,&k),i=1;i<2*n;++i)
	printf("%d %d\n",(i+1)/2,(i+1)/2+(i%2?0:1));
	printf("%d %d\n",n,1); int left=k-2*n,x=1,y=1;
	while (left>0)
	{
		auto expand=[&](void)
		{
			if (y==n) ++x,y=1; else ++y;
		};
		while (x==y||x%n+1==y) expand();
		--left; printf("%d %d\n",x,y);
		expand();
	}
	return 0;
}
